var dataObj = ""

function actionModFn(data) {
    let title = data.title ? data.title : "";
    let text = data.text ? data.text : "";
    let textStr = "";
    let typeStr = "";
    let type = data.type;
    let styleStr = ""
    let id = "modBody" + data.id
    if (type == "tab") {

    } else if (type == "api") {

        styleStr = `background-color:#52C41A;`
    }

    if (text instanceof Array) {
        for (let i = 0; i < text.length; i++) {
            textStr += `<div class='actionModContent' title='${text}'> ${text}</div>`
        }
    } else {
        textStr += `<div class='actionModContent' title='${text}'>${text}</div>`
    }
    dataObj = `<div class="modBody" id="${id}"><div class='actionMod' data-title='上标题下内容'>
        <div div class = 'actionModTitleDiv'
        data-title = '标题栏'
        style = '${styleStr}' >
          <div class='actionModTitle'>${title} </div>
        </div>
        <div class='actionModContentDiv' data-title='内容栏'>
         ${textStr}
        </div>
      </div>
     </div> 
      `;
    return dataObj
}


export default actionModFn;